{% extends "admin/base.html" %}
{% load i18n %}

{% block content %}
<div>
 	<h2 class="title1">{% trans "Edit pages" %}</h2>
 	<form id="posts-filter" action="{{ blog.get_admin_delete_articles_url }}" method="post">
 		<ul class="horizontal">
 			<li><a href="{% url admin_show_pages user.username %}">
 				{% trans "All" %}<span class="count">({{ all_count }})</span></a>|&nbsp;</li>
 			<li><a href="{% url admin__pages_published user.username %}">
 				{% trans "Published" %}<span class="count">({{ published_count }})</span></a>|&nbsp;</li>
 			<li><a href="{% url admin_pages_unpublished user.username %}">
 				{% trans "Unpublished" %}<span>({{ unpublish_count }})</span></a></li>
 		</ul>
 		<div class="clear"></div>
 		<!-- <div style="margin-top: 10px;">
			<input type="submit" class="submit button" id="doaction" name="delete" value="{% trans 'Delete' %}">
 		</div> -->
 		<table class="list">
			<thead>
				<tr>
					<th class="check-column">
					<input type="checkbox" onclick="$('input[name=checks]').attr('checked',this.checked);"></th>
					<th style="width:25%;">{% trans "Title" %}</th>
					<th>{% trans "Page alias" %}</th>
					<th>{% trans "Display order" %}</th>
					<th style="width:100px;" class="num"><img alt="Comments" src="/static/images/comment-grey-bubble.png"></th>
					<th style="width: 120px;">{% trans "Created date" %}</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<th class="check-column">
						<input type="checkbox" onclick="$('input[name=checks]').attr('checked',this.checked);"></th>
					<th>{% trans "Title" %}</th>
					<th>{% trans "Page alias" %}</th>
					<th>{% trans "Display order" %}</th>
					<th class="num"><img alt="Comments" src="/static/images/comment-grey-bubble.png"></th>
					<th>{% trans "Created date" %}</th>
				</tr>
			</tfoot>
			<tbody>
	         	{% if pages.object_list %}
	         	{% for page in pages.object_list %}
				<tr valign="middle" id="post-{{entry.id}}" class="list_item">
					<th scope="row" class="check-column">
						<input type="checkbox" name="checks" value="{{ page.id }}">
					</th>
					<td> 
		              	<strong>
		              		{% if page.is_published %}
		              		<a target="_blank" href="{{ page.get_absolute_url }}" title="{{ page.title }}" 
		              			class="row-title">
		              			{{ page.title }}</a>
		              		{%else%}
		              		<a target="_self" href="{{ page.get_admin_edit_page_url }}" 
		              			title="Edit &quot;{{ page.title }}&quot;" class="row-title">
		              			{{ page.title }}</a>
		              		{%endif%}
		              	</strong>
		              	<div class="row-actions">
			              	<span>
								<a href="{{ page.get_admin_edit_page_url }}" 
									title="Edit &quot;{{ page.title }}&quot;">{% trans "Edit" %}</a></span>
			              	<span>|
			              		<a class="delete" href="{{ page.get_admin_delete_page_url }}"
			              			onclick="return senbz.delete_confirm('{{ page.title }}')">
			              			{% trans "Delete" %}</a></span>
			              	{% if page.is_published %}
			              	<span>|
		              			<a target="_blank" href="{{ page.get_absolute_url }}" 
		              				title="{{ page.title }}">{% trans "Browse" %}</a>
		              		</span>
		              		{%endif%}
		              	</div>
		        	</td>
		        	<td>{{ page.slug }}</td>
		        	<td>{{ page.order }}</td>
		            <td class="num">{{ page.get_comments_count }}</td>
		            <td>
		            	{{ page.created_date|date:"Y-m-d"}}<br/>
		            	{% if page.is_published %}{% trans "Published" %}{% else %}{% trans "Unpublished" %}{% endif %}
		            </td>
				</tr>
				{%endfor%}
				{%else%}
				<tr>
					<td colspan="7" align="center" style="font-size: 16px;">{% trans "No pages" %},
						<a href="{% url admin_show_page user.username %}">{% trans "Add a page" %}</a></td>
				</tr>
				{%endif%}
			</tbody>
		</table>
 	</form>
 	{%if entrys%}
 	{%endif%}
</div>
{%endblock%}